package main

import (
	"log"

	"go-server-demo/internal/wire"

	"github.com/gin-gonic/gin"
)

func main() {
	// 初始化应用
	app, err := wire.InitializeApp()
	if err != nil {
		log.Fatalf("Failed to initialize app: %v", err)
	}

	// 设置中间件
	app.Use(gin.Logger())
	app.Use(gin.Recovery())

	// 启动服务器
	log.Println("Server starting on :8080")
	if err := app.Run(":8080"); err != nil {
		log.Fatalf("Failed to start server: %v", err)
	}
}
